package com.jdk.thread.action.room;

import org.joda.time.DateTime;

import com.jdk.thread.action.execaction.ActionQueue;
import com.jdk.thread.action.execaction.DelayAction;

/**
 * @Description :更新副本房间状态
 * @FileName: CampaignUpdateAction.java
 * @Author :WeiHui.Zhang
 * @Data : 2016年2月2日 下午6:20:07
 * @Version:V1.00
 */
public class CampaignUpdateAction extends DelayAction {

	private int delay;

	public CampaignUpdateAction(ActionQueue queue, long curTime, int delay) {
		super(queue, curTime, delay);
		this.delay = delay;
	}

	@Override
	public void execute() {
		long curTime = System.currentTimeMillis();
		DateTime dateTime = new DateTime();
		// 做其他事情
		//try {
			//TimeUnit.MILLISECONDS.sleep(5);
			System.out.println("更新副本房间状态 : curTime = " + dateTime.getSecondOfMinute());
		//} catch (InterruptedException e) {
		//	e.printStackTrace();
		//}
		execTime = curTime + delay;
		RoomMgr.getExeccutor().enDelayQueue(this);
	}
	
	public static void main(String[] args) {
		DateTime dateTime = new DateTime();
		System.out.println(dateTime.getSecondOfMinute());
	}

}
